package com.xiaoyun.bo.center;

import com.xiaoyun.annotation.PasswordMatch;
import com.xiaoyun.annotation.ValidMobile;
import com.xiaoyun.annotation.ValidPassword;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@ApiModel(value = "center用户对象BO", description = "从客户端，由用户传入的数据封装在此entity中")
@Data
@PasswordMatch
public class CenterUserBO {

    @ApiModelProperty(value = "用户名", name = "username", example = "xiaoyun", required = true)
    @NotBlank(message = "用户名不能为空")
    @Length(max = 12, message = "用户名长度不能超过12")
    private String username;

    @ApiModelProperty(value = "密码", name = "password", example = "123456", required = true)
    @ValidPassword
    @NotBlank(message = "密码不能为空")
    private String password;

    @ApiModelProperty(value = "确认密码", name = "confirmPassword", example = "123456", required = false)
    @NotBlank(message = "重输密码不能为空")
    private String confirmPassword;
    /**
     * 昵称 昵称
     */
    @NotBlank(message = "用户名不能为空")
    @Length(max = 12, message = "用户名长度不能超过12")
    private String nickname;

    /**
     * 真实姓名 真实姓名
     */
    @NotBlank(message = "用户名不能为空")
    @Length(max = 12, message = "用户名长度不能超过12")
    private String realname;

    /**
     * 头像 头像
     */
    private String face;

    /**
     * 手机号 手机号
     */
    @ValidMobile
    private String mobile;

    /**
     * 邮箱地址 邮箱地址
     */
    @Email
    private String email;

    /**
     * 性别 性别 1:男  0:女  2:保密
     */
    @Min(value = 0, message = "性别选择不正确")
    @Max(value = 2, message = "性别选择不正确")
    private Integer sex;

    /**
     * 生日 生日
     */
    private Date birthday;

}
